#include <algorithm>
#include <unordered_map>
#include <utility>
#include<vector>
#include<string>
using namespace std;

class Solution {
public:
    vector<vector<string>> groupAnagrams(vector<string>& strs) {
        unordered_map<string, vector<string>> m;
        for(int i=0;i<strs.size();i++){
            string ns=strs[i];
            sort(ns.begin(),ns.end());
            m[ns].push_back(std::move(strs[i]));
        }
        vector<vector<string>> ans;
        for(auto &s :m){
            ans.push_back(std::move(s.second));
        }
        return ans;
    }
};


int main(){

}